<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/tt.css" />

    <style>
        html {
            background: rgba(0, 0, 0, 0.65);
        }

        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        .out {
            width: 553px;
            height: 636px;
            background-color: #fff;
            padding: 50px 80px 0;
            box-sizing: border-box;
            position: relative;
            margin: auto;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
        }

        .close {
            width: 22px;
            height: 22px;
            position: absolute;
            right: 20px;
            top: 20px;
        }

        .deng {
            font-size: 20px;
            /*font-weight: 600;*/
            color: rgba(102, 102, 102, 1);
            line-height: 28px;
            text-align: right;
        }

        .zhu {
            font-size: 20px;
            font-weight: 600;
            color: rgba(51, 51, 51, 1);
            line-height: 28px;
        }

        .zh {
            color: #333;
            font-size: 15px;
            /* font-weight: 600; */
            line-height: 21px;
            margin: 24px 0 8px;
        }

        .outer {
            /*margin-top: 1rem;*/
            align-items: center;
            border-bottom: 1px solid #EEEEEE;
        }

        input[type="tel"],
        input[type="text"],
        input[type="password"] {
            height: 42px;
            margin: 0;
            padding: 0;
            font-size: 13px;
            color: #333;
            background: transparent;
            outline: none;
        }

        input::-webkit-input-placeholder {
            color: #999;
        }

        .cord {
            font-size: 14px;
            font-weight: 600;
            color: rgba(153, 153, 153, 1);
            line-height: 18px;
        }

        .outer3 {
            justify-content: space-between;
        }

        .tx_yzm {
            width: 90px;
            height: 40px;
            margin-top: 40px;
        }

        .btn {
            height: 52px;
            background: #FC2B40;
            border-radius: 26px;
            font-size: 16px;
            color: rgba(255, 255, 255, 1);
            line-height: 52px;
            text-align: center;
            margin-top: 40px;
            position: relative;
        }

        .kuai_deng {
            font-size: 13px;
            color: rgba(153, 153, 153, 1);
            line-height: 50px;
            text-align: center;
        }
        .btn:hover{
            -webkit-box-shadow:0px 10px 15px rgba(252,43,64,0.2);
        }
        .btn:active{
            -webkit-box-shadow:none;
        }
        .btn:active span{
            display: inline-block;
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.2);
            border-radius:26px;
        }
        /*禁用状态*/
        .btn1{
            background:rgba(204,204,204,1);
        }
        .hand_icon{
            cursor:pointer;
        }
    </style>
</head>

<body>
<form class="form">
<div class="out">
    <img src="__IMG__/close1.png" alt="" class="close">
    <div class="flex-wrap" style="margin-bottom:32px;">
        <div class="flex-con deng" onclick="location.href='{:url('shop/Login/indexLogin')}'">登录</div>
        <div style="width:56px;"></div>
        <div class="flex-con zhu">注册</div>
    </div>
    <div class="zh">邮箱账号</div>
    <div class="outer">
        <input type="tel" name="email" class="flex-con" placeholder="请输入您的邮箱账号" id="user_phone">
    </div>
    <div class="zh">邀请码</div>
    <div class="outer outer3 flex-wrap">
        <input type="tel" name="user_create_id" class="flex-con" placeholder="请输入您的邀请码">
    </div>
    <div class="zh">密码</div>
    <div class="outer outer3 flex-wrap">
        <input type="password" name="pwd" class="flex-con" placeholder="请输入您的密码">
    </div>
    <div class="zh">确认密码</div>
    <div class="outer outer3 flex-wrap">
        <input type="password" name="oldpwd" class="flex-con" placeholder="请再次输入您的密码">
    </div>
    <div class="btn hand_icon" onclick="login()" tapmode>注册<span></span></div>
    <div class="kuai_deng hand_icon" onclick="location.href='{:url('shop/Login/register')}'">手机号注册</div>
</div>
</form>
</body>
</html>
<script src="/static/admin/js/jquery.min.js"></script>
<script>
    function login() {
        var pattern = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
        if(!pattern.test($('#user_phone').val())){
            alert('请输入正确的邮箱号');
            return false;
        }
        $.ajax({
            url:"{:url('shop/Login/register1')}",
            type:'post',
            data:$('.form').serialize(),
            dataType:'json',
            success:function(res){
                if(res.status != 200){
                    alert(res.msg);
                    return false;
                }else{
                    window.location.href=res.url + '?user_id=' + res.msg;
                }
            }
        })
    }
</script>